package com.elvis.chat.utils.add;

public class MessageBodyType {
    /** message body type text. */
    public static final int MSG_BODY_TYPE_TEXT = 0;

    /** message body type image. */
    public static final int MSG_BODY_TYPE_IMAGE = 1;

    /** message body type audio. */
    public static final int MSG_BODY_TYPE_AUDIO = 2;

    /** message body type video. */
    public static final int MSG_BODY_TYPE_VIDEO = 3;

    /** message body type other. */
    public static final int MSG_BODY_TYPE_OTHER = 4;

    /**
     * Private default constructor.
     */
    private MessageBodyType() {
    }

    public static int getBodyType(final String mimeType) {
	int bodyType = MessageBodyType.MSG_BODY_TYPE_TEXT;
	if (FileUtil.isImageType(mimeType)) {
	    bodyType = MessageBodyType.MSG_BODY_TYPE_IMAGE;
	} else if (FileUtil.isVideoType(mimeType)) {
	    bodyType = MessageBodyType.MSG_BODY_TYPE_VIDEO;
	} else if (FileUtil.isAudioType(mimeType)) {
	    bodyType = MessageBodyType.MSG_BODY_TYPE_AUDIO;
	} else if (FileUtil.isTextType(mimeType)) {
	    bodyType = MessageBodyType.MSG_BODY_TYPE_TEXT;
	} else {
	    bodyType = MessageBodyType.MSG_BODY_TYPE_OTHER;
	}
	return bodyType;
    }
}
